<table id="lista">
  <thead>
    <tr>
      <th>Plant</th>
      <th>Name</th>
      <th>Pn</th>
      <th>Enable</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($subPlants as $key=>$subPlant){
        
            $odd = fmod($key, 2) ? 'odd' : 'even';?>
            <tr class="<?php echo $odd?>">
              <td><a href="<?php echo url_for('subplant/show?id='.$subPlant->getId()) ?>"><?php echo $subPlant->getPlant() ?></a></td>
              <td><?php echo $subPlant->getName() ?></td>
              <td><?php echo $subPlant->getPn() ?></td>
              <td><?php echo $subPlant->getEnable() ?></td>
            </tr>
    <?php } ?>
  </tbody>
</table>
